# coding=utf-8
"""
Created on 2018年09月18日
"""
import math
from util_base import common_utils


def for_you_article_score(cv_count, like_count, share_count, comment_count, reg_date):
    """
    fou you 页视频公式
    """
    A = 36000
    t = common_utils.datetime_to_timestamp('2016-01-01 00:00:00')
    T = common_utils.datetime_to_timestamp(str(reg_date))

    H = 1 * (cv_count + 1) + 1.2 * like_count + 1.3 * share_count + 1.5 * comment_count
    score = int((math.log(H) + float(T - t) / A) * 1000)

    return score